program arr
    implicit none
    real(8), dimension(4,4) :: ar
    real(8), dimension(3,3) :: ar2
    integer :: i, j
    ar = 1.0; ar2 = 0.0
    do i = 1,3
        ar(1:3,i) = ar2(:,i)
    end do
    call print_matrix(ar)

    ! do j = 1,4
    !     do i = 1,3
    !         ar(j,i) = i + (j-1)*3
    !     end do
    ! end do

    ! write(*,*) ar(1,:)
    ! write(*,*)  "                                               "  
    ! write(*,*) ar(2,:)
    ! write(*,*)    "                                               "  
    
    ! write(*,*) ar(3,:)
    ! write(*,*)    "                                               "  
    
    ! write(*,*) ar(4,:)
    contains
        subroutine print_matrix(A)
            integer, parameter :: dbl = 8
            real(dbl), dimension(:,:), intent(in) :: A
            integer :: row, k
            row = size(A,1)
            do k = 1, row
                write(*,*) A(k,:)
            end do
            write(*,*)
        end subroutine print_matrix
          
end program arr

